﻿

using System.Collections.Generic;

namespace IDEAMS.model.setting
{
    public class GlobalSettingViewModel : ViewModelBase
    {
        public GlobalSettingViewModel()
        {

        }

        public GlobalSettingViewModel(GlobalSetting setting)
        {
            this.alarmSoundOn = setting.alarmSoundOn;
            this.threshold = new ThresholdSettingViewModel(setting.threshold);
            this.continuousRunTime = setting.continuousRunTime;
            this.instectionSequence = new List<ProcessStep>();
            foreach (var item in setting.inspectionSequences)
            {
                this.instectionSequence.Add((ProcessStep)item);
            }
        }

        private bool m_alarmSoundOn;
        public bool alarmSoundOn
        {
            get { return m_alarmSoundOn; }
            set
            {
                m_alarmSoundOn = value;
                NotifyPropertyChanged();
            }
        }

        private ThresholdSettingViewModel m_threshold;
        public ThresholdSettingViewModel threshold
        {
            get { return m_threshold; }
            set
            {
                m_threshold = value;
                NotifyPropertyChanged();
            }
        }

        private double m_continuousRunTime;
        public double continuousRunTime
        {
            get { return m_continuousRunTime; }
            set
            {
                m_continuousRunTime = value;
                NotifyPropertyChanged();
            }
        }

        /// <summary>
        /// 检验顺序
        /// </summary>
        private List<ProcessStep> m_inspectionSequence;
        public List<ProcessStep> instectionSequence
        {
            get { return m_inspectionSequence; }
            set
            {
                m_inspectionSequence = value;
                NotifyPropertyChanged();
            }
        }
    }
}
